---
title: "Accessing the Web App"
description: "Accessing the Web App"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Using EJAM}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r developernote, eval=FALSE, echo= FALSE, include = FALSE}
#  *>>>>>>>>>> Developer note: vignettes need to be tested/edited/rebuilt regularly <<<<<<<<<<<*
#    - **See ?pkgdown::build_site** and script in EJAM/data-raw/- EJAM uses the pkgdown R package to build help and articles/ vignettes as web pages
```

```{r SETUP_default_eval_or_not, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
knitr::opts_chunk$set(eval = FALSE)
# https://r-pkgs.org/vignettes.html
```

# Web app for the public via EJScreen's Multisite Tool

*EPA has integrated EJAM's toolkit as the EJScreen Multisite Tool*. EPA's [EJScreen](https://www.epa.gov/ejscreen "https://www.epa.gov/ejscreen"){.uri target="_blank" rel="noreferrer noopener"} provides public access to batches of EJ reports, with rapid multisite analysis, by leveraging the EJAM toolkit.

# Web app for EPA staff

EPA staff while on the Agency network can access an [internal version of the EJAM web app](https://usepa.sharepoint.com/sites/EJAMWorkgroup/SitePages/access-ejam.aspx). It is for use by staff at EPA offices or via VPN, and requires SSO authentication with a PIV card.

```{=html}
<!--
EPA staff can use version 2.32 of the internal EJAM web app - The tool is accessible only at EPA offices or via VPN -- You must be inside EPA's network (e.g. using VPN) to access the EJAM web app, and need to SSO authenticate with PIV card.
-->
```
# Web app for analysts or developers using R/RStudio

*The EJAM software and data are available as open source resources*, so that anyone (not just EPA staff) can use EJAM in RStudio on their own computer.

EPA staff (on-site or on the VPN) can access the internal version of the EJAM repository as explained [here](https://usepa.sharepoint.com/sites/EJAMWorkgroup/SitePages/access-ejam.aspx).

*Assuming you have access to the code repository, the following will apply:*

Analysts or developers using R/RStudio have the option of running a local copy of the EJAM web app on their own computer. This may be even faster than relying on the hosted web app, does not time out after inactivity, and could be customized by a developer. You can also launch it with customized options or use bookmarked settings.

If you use the R programming language in RStudio, you can use EJAM through a web-based UI run on your own computer (and/or use EJAM functions and data directly without the web app, for more complex work).

You first need to install the EJAM R package and datasets as explained in [Installing the EJAM R package](https://usepa.github.io/EJAM/articles/1_installing.html). There is also a [Quick Start guide](https://usepa.github.io/EJAM/articles/2_quickstart.html) and extensive [documentation of EJAM functions/tools/data](https://usepa.github.io/EJAM/reference/index.html).

Once EJAM is installed, you can launch the local web app from RStudio as follows:

```{r run_app1, eval = FALSE, include= TRUE}
library(EJAM)
options(shiny.launch.browser = TRUE) # so the web app uses a browser (not the RStudio viewer)

run_app()
```

The EJScreen Multisite Tool configuration is available via `run_app(isPublic=T)` and the version for staff use is available via `run_app(isPublic=F)`

See documentation of optional parameters here: <https://usepa.github.io/EJAM/reference/run_app.html> or via `?run_app`

Note this is different than running a simple shiny app that is not also a package via the golem package. You should use the EJAM package function `run_app()` not `shiny::runApp()`.

```{=html}
<!--
EJAM has a series of high-level functions that an analyst can use in RStudio - EJAM can be installed and then used in RStudio as explained in the articles on Installing the EJAM R package and the Quick Start Guide.
-->
```
